import 'package:flutter/material.dart';

class VideoSpeedItem {
  final double speed;
  final String title;

  VideoSpeedItem({this.speed = 1.0, this.title = '1X'});
}

class VideoSpeedItemStyle {
  final Color backgroundColor;
  final Size itemSize;
  final AlignmentGeometry alignment;
  final TextStyle textStyle;
  final TextStyle selectedTextStyle;
  final TextAlign textAlign;
  final BorderRadius radius;

  VideoSpeedItemStyle({
    Color? backgroundColor,
    this.itemSize = const Size(45, 30),
    this.radius = const BorderRadius.all(Radius.circular(8.0)),
    this.alignment = Alignment.centerLeft,
    this.textAlign = TextAlign.left,
    this.textStyle = const TextStyle(
      fontSize: 14.0,
      fontWeight: FontWeight.normal,
      color: Colors.white,
    ),
    this.selectedTextStyle = const TextStyle(
      fontSize: 14.0,
      fontWeight: FontWeight.bold,
      color: Colors.blue,
    ),
  }) : backgroundColor = backgroundColor ?? Colors.transparent;
}

class VideoSpeedButtonStyle {
  final TextStyle textStyle;
  final String title;

  VideoSpeedButtonStyle({
    this.title = '倍速',
    this.textStyle = const TextStyle(
      fontSize: 14.0,
      fontWeight: FontWeight.normal,
      color: Colors.white,
    ),
  });
}

class VideoSpeedTipStyle {
  final AlignmentGeometry alignment;
  final Size size;
  final Widget icon;
  final Decoration decoration;
  final EdgeInsetsGeometry middlePadding;
  final TextStyle speedTextStyle;
  final TextStyle describeTextStyle;
  final String describe;

  VideoSpeedTipStyle({
    this.alignment = const FractionalOffset(0.5, 0.2),
    this.size = const Size(140.0, 40.0),
    this.icon = const Icon(Icons.speed, size: 20.0, color: Colors.white),
    this.decoration = const BoxDecoration(
      color: Color(0x7F000000),
      borderRadius: BorderRadius.all(Radius.circular(4.0)),
    ),
    this.middlePadding = const EdgeInsets.symmetric(horizontal: 14.0),
    this.speedTextStyle = const TextStyle(color: Colors.blue),
    this.describeTextStyle = const TextStyle(color: Colors.white),
    this.describe = '快进中',
  });
}
